import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FormsModule,ReactiveFormsModule} from '@angular/forms';


import { AppComponent } from './app.component';
import { LoginComponent } from './login/login.component';
import { ShareModule } from './share/share.module';


/**
 * 注入应用程序的全局服务
 */

import { RootService } from './root.service';


@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule.forRoot([
       {path:'login',component:LoginComponent},
       {path:'home',loadChildren:'./home/home.module#HomeModule'},
       {path:'',redirectTo:'login',pathMatch:'full'},
    ]),
    ShareModule
  ],
  providers: [RootService],
  bootstrap: [AppComponent]
})
export class AppModule { }



